<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ page import="com.control.LoginControl" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Expires" content="0">
<title>检查登录</title>
</head>
<body>
<%
String user_num=request.getParameter("user_num");
String user_pwd=request.getParameter("user_pwd");
boolean type=Boolean.parseBoolean(request.getParameter("type"));
//System.out.println(type);
LoginControl lc=new LoginControl();
if(type==true)
{
if(lc.isStu(user_num,user_pwd))
	//System.out.println("你好！");
	session.setAttribute("user_num",user_num);
    session.setAttribute("user_pwd",user_pwd);
    session.setAttribute("user_id",lc.getStuId(user_num,user_pwd));
    //session.setAttribute("type",type);
	response.sendRedirect("student_login.jsp");
}
else if(lc.isAdmin(user_num,user_pwd) )
	{
	//System.out.println("你好！");
	session.setAttribute("user_num",user_num);
	//System.out.println(session.getAttribute("username"));
    session.setAttribute("user_pwd",user_pwd);
    session.setAttribute("user_id",lc.getAdminId(user_num,user_pwd));
    //System.out.println(session.getAttribute("password"));
	response.sendRedirect("admin_login.jsp");
	}
else
{
	 %>
	  <script language="javascript">
				alert("用户类别或密码错误");
				window.location.href="login.jsp"
			</script>
	 <%}
%>
</body>
</html>